import 'package:flutter_douban/model/note_content_model.dart';
import 'package:flutter_douban/model/tag_list_model.dart';
import 'package:json_annotation/json_annotation.dart';
import 'user_model.dart';
part 'note_model.g.dart';

/// 评论笔记
class NoteModelList {
  List<NoteModel> list;
  NoteModelList(this.list);
  factory NoteModelList.fromJson(List<dynamic> list) {
    return NoteModelList(
      list.map((item) => NoteModel.fromJson(item)).toList(),
    );
  }
}

@JsonSerializable()
class NoteModel {
  String? cover_height;
  String? cover_width;
  int? favo_state;

  String? image_u_gif;
  /// 喜欢数量
  int? like_count;
  /// 喜欢数量字符串
  String? like_count_text;
  /// 收藏字符串
  String? favo_count_text;
  /// 喜欢状态
  int? like_state;
  /// 时间
  String? publishtime;
  String? recall;
  String? straight_text;
  /// 文字描述
  String? title;
  /// 视频图片
  String? video_cover;
  /// 视频高度
  String? video_cover_height;
  /// 视频宽度
  String? video_cover_width;
  /// 视频url
  String? video_url;
  /// 年
  String? year_text;
  /// 活动图片
  String? action_icon;
  /// 活动名称
  String? action_title;
  /// 活动url
  String? action_url;
  /// 作者
  UserModel? author;
  /// 活动id
  String? id;
  /// 图片
  String? image_u;
  /// 图片高度
  String? image_h;
  /// 图片宽度
  String? image_w;
  /// 标题
  String? name;
  ///
  int? sortnum;
  /// 数量
  int? cc;
  /// 站位文字
  String? comment_hint;
  /// 评论数量
  String? comments_count_text;
  /// 文字数组
  List<NoteContentModel>? contents;
  /// 评论数组
  List<NoteContentModel>? cs;
  /// 轮播图片
  List<TagListModel>? images;
  /// 用户头像图片
  String? p;
  /// 用户名字
  String? n;
  /// 是否收藏过
  bool? is_collection;

  NoteModel(this.action_icon,this.action_title,this.action_url,this.author,this.id,this.image_u,this.image_h,
      this.image_w,this.name,this.sortnum,this.cc,this.comment_hint,this.comments_count_text,this.contents,this.cs,
      this.images,this.like_count,this.title,this.cover_height,this.cover_width,this.favo_count_text,this.favo_state
      ,this.image_u_gif,this.like_count_text,this.like_state,this.publishtime,this.recall,this.straight_text,this.video_cover,
      this.video_cover_height,this.video_cover_width,this.video_url,this.year_text,this.p,this.n,this.is_collection);
  factory NoteModel.fromJson(Map<String,dynamic> json) => _$NoteModelFromJson(json);
  Map<String, dynamic> toJson() => _$NoteModelToJson(this);

}

